package student.test.DAO;
import org.springframework.stereotype.Repository;
import student.test.entity.User;

import java.util.ArrayList;
import java.util.List;

@Repository
public class UsersDAO {
    private List<User> users;
    public UsersDAO(){
        users = new ArrayList<>();
        User user = new User();
        user.setUserName("zyb");
        user.setPassword("123456");
        users.add(user);

        user = new User();
        user.setUserName("aa");
        user.setPassword("123456");
        users.add(user);
    }
    public boolean verify(User user){
        for (User u : users){
            if(u.getUserName().equals(user.getUserName()) && u.getPassword().equals(user.getPassword())){
                return true;
            }
        }
        return false;
    }
}
